﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace huaguwang.virtualWeb.uc.book
{
    public partial class book_hot : System.Web.UI.UserControl
    {
        private readonly D_T_EBook_Exp dal = new D_T_EBook_Exp();
        public enum e_type
        {
            热门书籍 = 1,
            热门资源 = 2
        }
        public e_type EType { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            var dt = new List<M_Page>();
            switch(EType)
            {
                case e_type.热门书籍:
                    dt = dal.GetOrder(10, true, null);
                    break;
                case e_type.热门资源:
                    dt = dal.GetOrderAll(10, true);
                    break;
                default:
                    break;
            }
            if(!IsPostBack)
            {
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
            }
        }
    }
}